//package fnic.prehand.common;
//
//import java.util.ResourceBundle;
//
//import org.apache.log4j.Logger;
//
//import redis.clients.jedis.Jedis;
//import redis.clients.jedis.JedisPool;
//import redis.clients.jedis.JedisPoolConfig;
//
//public class RedisClientPool {
//	private static final AgentConfig config = AgentConfig.getInstance();
//	private static final Logger logger = Logger.getLogger(RedisClientPool.class);
//	private static final JedisPoolConfig redisconfig;
//	
//	private JedisPool jedisPool;
////	private static volatile JedisPool passjedisPool;
//	
//	static{
//        //创建jedis池配置实例  
//        redisconfig = new JedisPoolConfig();   
//	        
//        int maxActivity = config.getJedisMaxTotal();  
//        int maxIdle = config.getJedisMaxIdle();  
//        long maxWait = config.getJedismaxWaitMillis();  
//        boolean testOnBorrow = config.isJedistestOnBorrow();  
//        boolean onreturn = config.isJedistestOnReturn();  
//	        
//        //设置池配置项值  
//        redisconfig.setMaxTotal(maxActivity);
//        redisconfig.setMaxIdle(maxIdle);    
//        redisconfig.setMaxWaitMillis(maxWait); //milli seconds
//        redisconfig.setTestOnBorrow(testOnBorrow);    
//        redisconfig.setTestOnReturn(onreturn);  
////		jedisPool = new JedisPool(redisconfig, config.getRedisHost(), config.getRedisPort(), 0, config.getRedisPsw(), config.getRedisDB());	
//		activejedisPool = new JedisPool(redisconfig, config.getRedisHost(), config.getRedisPort());
////		passjedisPool = new JedisPool(redisconfig, config.getPredisHost(), config.getPredisPort());
//	}
//	
//	public RedisClientPool(String host, String host, int port){
//		jedisPool = new JedisPool(redisconfig, host, port);
//	}
//	
//	public static Jedis getAtvRedisResource(){
//		Jedis jedis = activejedisPool.getResource();
//		return jedis;
//	}
//	
//	public static void returnAtvRedisResource(Jedis jedis){
//		activejedisPool.returnResource(jedis);
//	}
//	
//	public static void returnAtvBrokenRedisRes(Jedis jedis){
//		activejedisPool.returnBrokenResource(jedis);
//	}
//	
//	public static Jedis getPsvRedisResource(){
//		Jedis jedis = passjedisPool.getResource();
//		return jedis;
//	}
//	
//	public static void returnPsvRedisResource(Jedis jedis){
//		passjedisPool.returnResource(jedis);
//	}
//}
